import { onMounted, onUnmounted } from 'vue'
import { useDebounceFn } from '@vueuse/core'

export default function (callback) {
  const callbackDebounce = useDebounceFn(() => callback(), 300)
  onMounted(() => window.addEventListener('resize', callbackDebounce))
  onUnmounted(() => window.removeEventListener('resize', callbackDebounce))
}
